import { request } from '@/utils/request'

// 查询督办申请列表
export function listSupervise(query) {
  return request({
    url: '/workorder/woSupervise/list',
    method: 'get',
    params: query
  })
}

// 查询督办申请列表
export function listSuperviseAll(query) {
  return request({
    url: '/workorder/woSupervise/list/all',
    method: 'get',
    params: query
  })
}

// 查询督办申请详细
export function getSupervise(id) {
  return request({
    url: '/workorder/woSupervise/' + id,
    method: 'get'
  })
}

// 新增督办申请
export function addSupervise(data) {
  return request({
    url: '/workorder/woSupervise',
    method: 'post',
    data: data
  },{
    successMsg:"操作成功！"
  })
}

// 修改督办申请
export function updateSupervise(data) {
  return request({
    url: '/workorder/woSupervise',
    method: 'put',
    data: data
  })
}

// 删除督办申请
export function delSupervise(id) {
  return request({
    url: '/workorder/woSupervise/' + id,
    method: 'delete'
  })
}

// 初始化督办申请单
export function getInitSupervise() {
  return request({
    url: '/workorder/woSupervise/getInitSupervise',
    method: 'get'
  })
}

// 审核流程
export function approveSupervise(data) {
  return request({
    url: '/workorder/woSupervise/approve',
    method: 'post',
    data: data
  },{
    successMsg:"操作成功！"
  })
}